/**
  *用户信息
  *
  **/
CommonUtils.regNamespace("user", "info");

user.info = (function(){
	
	var _userdata = {
		"userName":"",
		"userId":"",
		"roleIds":"",
		"projectRoleId":"" //用户对项目所拥有的权限
	};
	
	var _updateUser = function(){
		var oldUserPwd = $("#oldUserPwd").val();
		var newUserPwd = $("#newUserPwd").val();
		var params = {
				"oldUserPwd":oldUserPwd,
				"newUserPwd":newUserPwd
				};
		var path= contextPath+"/user/updateUser";
		$.ajax({
	        type:"POST",
	        url:path,
	        data:JSON.stringify(params),
	        contentType:"application/json; charset=utf-8",
	        dataType: "json",
	        async:false,
	        success:function(respone){
	        	$("#updateModal").modal('hide');
	        	if(respone){
	        		if(respone.code==0){
	        			alert("修改成功");
	        		}else{
	        			alert(respone.message);
	        		}
	        	}else{
	        		alert("修改失败");
	        	}
	        },error:function(respone){
	            alert("请求发生错误:"+respone);
	        }
	    });
	}
	return{
		userdata:_userdata,
		updateUser:_updateUser
	}
})();